package day08;


import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.junit.Test;

import day07_homework.Student;

public class set {
	@Test
	public void SetTest() {
		List<Student> list = new ArrayList<>();
		Student student1 = new Student(1, "zjx1", 21, "Java");
		Student student2 = new Student(2, "zjx2", 21, "Java2");
		Student student3 = new Student(3, "zjx3", 21, "Java3");
		list.add(student1);
		list.add(student2);
		list.add(student3);
		list.add(student1);
		for (Student student : list) {
			System.out.println(student);
		}
		System.out.println();
		Set<Student> set= new HashSet<>();
		set.add(student1);
		set.add(student2);
		set.add(student3);
		set.add(student1);
		for (Student student : set) {
			System.out.println(student);
		}
		
	}
	
}
